
package org.tau.workshop2011.showcase

object MainDemo {
  def apply() =
"""Emailtextbox <- (label:(SenderW)x(EEHeight))[text = EmailSender(i), fgcolor = EEfgcol(i), bgcolor = EEbgcol(i)] | (button)[text = EmailSubject(i), fgcolor = EEfgcol(i), bgcolor = EEbgcol(i), checked = ?(false), active = Activate(i,checked) + 5]

EmailList  <- (((Emailtextbox)
                   *---*
                 [i=0...15]):?x(ListHeight))

EmailView <-

  (label:(descW)x(descH))[text = AdressLabel]    | (textbox:?x?) [text = readSender]
                                            ---
  (label:(descW)x(descH))[text = "Subject:"] | (textbox:?x?) [text = readSubject]
                                            ---
                                (textbox)[text = readContent]


main_window <- (

        (button:100x30)[text = "New", checked = NewC] | (button:100x?)[text = "Reply", checked = ReplyC] | (button:100x?)[text = "Refresh", checked = RefreshC] | ()
                                      ---
  (EmailList) | (EmailView)[readContent = EmailContent(Active), readSender = EmailSender(Active), readSubject = EmailSubject(Active), AdressLabel = "From: "]

)[SenderW = ?(150), ListHeight = height - 30, EEHeight = ?(30), descW = ?(150), descH = ?(30), NewC = ?(false), ReplyC = ?(false), RefreshC = ?(false), Active = ?(0)]


reply_window <- (

    (EmailView:?x(height-30))[descW = ?(150), descH = ?(30), AdressLabel = "To: "]
                    ---
  (button:100x?)[text = "Submit", checked = SubmitC] | ()

)[readContent = ?, readSender = ?, readSubject = ?, SubmitC = ?(false)]"""
}


object Radios {
  def apply() = """ main_window <-
    (((radio:30x30)[checked = v = i] | (label)[text = Animals[i]])
                           *---*
     [i=0...6,Animals={"Alpaca","Bunny","Cat","Dog","Elephant","Fox","Goose"}])[v=?(3)]
    """
}

object VSplitWithScroll {
  def apply() = """ main_window <- (
    (button:?x(height/2))
           ---
    (button:?x(height/2))
           ---
    (button:?x(height/2))
  )
    """
}